home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / DTS Sample Code / Macintosh Sample Code / SC.018.StdFile / StdFile.r < prev   
Encoding:
Text File  |  1991-10-09  |  23.5 KB  |  671 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    Standard File Sample Application
  6. #
  7. #    StdFile
  8. #
  9. #    StdFile.r    -    Rez Source
  10. #
  11. #    Copyright © 1989 Apple Computer, Inc.
  12. #    All rights reserved.
  13. #
  14. #    Versions:    
  15. #                1.00                04/89
  16. #                2.0                    05/90
  17. #
  18. #    Components:
  19. #                StdFile.c            April 1, 1989
  20. #                StdFile.p            April 1, 1989
  21. #                StdFile.h            April 1, 1988
  22. #                StdFile.r            April 1, 1988
  23. #                StdFile.rsrc        April 1, 1988
  24. #                CStdFile.make        April 1, 1989
  25. #                PStdFile.make        April 1, 1988
  26. #                Utilities.p            June, 1990
  27. ------------------------------------------------------------------------------*/
  28.  
  29. #include "Types.r"
  30. #include "SysTypes.r"
  31.  
  32. #include "StdFile.h"
  33.  
  34.  
  35. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  36.  
  37. /* These #defines are used to set enable/disable flags of a menu */
  38.  
  39. #define AllItems    0b1111111111111111111111111111111    /* 31 flags */
  40. #define NoItems        0b0000000000000000000000000000000
  41. #define MenuItem1    0b0000000000000000000000000000001
  42. #define MenuItem2    0b0000000000000000000000000000010
  43. #define MenuItem3    0b0000000000000000000000000000100
  44. #define MenuItem4    0b0000000000000000000000000001000
  45. #define MenuItem5    0b0000000000000000000000000010000
  46. #define MenuItem6    0b0000000000000000000000000100000
  47. #define MenuItem7    0b0000000000000000000000001000000
  48. #define MenuItem8    0b0000000000000000000000010000000
  49. #define MenuItem9    0b0000000000000000000000100000000
  50. #define MenuItem10    0b0000000000000000000001000000000
  51. #define MenuItem11    0b0000000000000000000010000000000
  52. #define MenuItem12    0b0000000000000000000100000000000
  53. #define MenuItem13    0b0000000000000000001000000000000
  54. #define MenuItem14    0b0000000000000000010000000000000
  55. #define MenuItem15    0b0000000000000000100000000000000
  56. #define MenuItem16    0b0000000000000001000000000000000
  57. #define MenuItem17    0b0000000000000010000000000000000
  58. #define MenuItem18    0b0000000000000100000000000000000
  59. #define MenuItem19    0b0000000000001000000000000000000
  60. #define MenuItem20    0b0000000000010000000000000000000
  61. #define MenuItem21    0b0000000000100000000000000000000
  62. #define MenuItem22    0b0000000001000000000000000000000
  63. #define MenuItem23    0b0000000010000000000000000000000
  64. #define MenuItem24    0b0000000100000000000000000000000
  65. #define MenuItem25    0b0000001000000000000000000000000
  66. #define MenuItem26    0b0000010000000000000000000000000
  67. #define MenuItem27    0b0000100000000000000000000000000
  68. #define MenuItem28    0b0001000000000000000000000000000
  69. #define MenuItem29    0b0010000000000000000000000000000
  70. #define MenuItem30    0b0100000000000000000000000000000
  71. #define MenuItem31    0b1000000000000000000000000000000
  72.  
  73.  
  74.  
  75. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  76. // menu resources
  77.  
  78. resource 'MBAR' (rMenuBar, preload) {
  79.     {mApple, mFile, mEdit, mSFile};
  80. };
  81.  
  82. resource 'MENU' (mApple, "Apple", preload) {
  83.     mApple, textMenuProc, (AllItems & ~MenuItem2), enabled, apple,
  84.     {
  85.         "About " AppName "…", noicon, nokey, nomark, plain;
  86.         "-", noicon,    nokey, nomark, plain
  87.     }
  88. };
  89.  
  90. resource 'MENU' (mFile, "File", preload) { /* enable Quit only */
  91.     mFile, textMenuProc, (NoItems | MenuItem12), enabled, "File",
  92.     {
  93.         "New",            noicon, "N", nomark, plain;
  94.         "Open…",        noicon, "O", nomark, plain;
  95.         "-",            noicon, nokey, nomark, plain;
  96.         "Close",        noicon, "W", nomark, plain;
  97.         "Save",            noicon, "S", nomark, plain;
  98.         "Save As…",     noicon, nokey, nomark, plain;
  99.         "Revert",        noicon, nokey, nomark, plain;
  100.         "-",            noicon, nokey, nomark, plain;
  101.         "Page Setup…",    noicon, nokey, nomark, plain;
  102.         "Print…",        noicon, nokey, nomark, plain;
  103.         "-",            noicon, nokey, nomark, plain;
  104.         "Quit",            noicon, "Q", nomark, plain
  105.     }
  106. };
  107.  
  108. resource 'MENU' (mEdit, "Edit", preload) {
  109.     mEdit, textMenuProc, NoItems, enabled, "Edit",
  110.      {
  111.         "Undo",            noicon, "Z", nomark, plain;
  112.         "-",            noicon, nokey, nomark, plain;
  113.         "Cut",            noicon, "X", nomark, plain;
  114.         "Copy",            noicon, "C", nomark, plain;
  115.         "Paste",        noicon, "V", nomark, plain;
  116.         "Clear",        noicon, nokey, nomark, plain
  117.     }
  118. };
  119.  
  120. resource 'MENU' (mSFile, "Examples", preload) {
  121.     mSFile, textMenuProc, (AllItems), enabled, "Examples",
  122.      {
  123.         "Get Full Path…",                noicon, nokey, nomark, plain;
  124.         "PGetFile with Filter…",        noicon, nokey, nomark, plain;
  125.         "PGetFile with Complex Filter…",noicon, nokey, nomark, plain;
  126.         "PGet a directory…",            noicon, nokey, nomark, plain;
  127.         "PGet Multiple Files…",            noicon, nokey, nomark, plain;    
  128.         "-",                            noicon, nokey, nomark, plain;            
  129.         "PutFile…",                        noicon, nokey, nomark, plain;
  130.         "PPutFile with Format…",        noicon, nokey, nomark, plain;
  131.         "PutFile in System Folder…",    noicon, nokey, nomark, plain;
  132.         "PPutFile with List…",            noicon, nokey, nomark, plain;
  133.         "PPutFile with Options…",        noicon, nokey, nomark, plain;
  134.         "-",                            noicon, nokey, nomark, plain;            
  135.         "Idle time and Updates…",        noicon, nokey, nomark, plain;
  136.         "Remember File…",                noicon, nokey, nomark, plain;
  137.     }
  138. };
  139.  
  140.  
  141. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  142. // These are the resources used to create the bungle package used by the Finder.
  143.  
  144. type rAppSignature as 'STR ';
  145.  
  146. resource rAppSignature (rAppBundle, purgeable) {
  147.     "Sample Standard File Routines - Macintosh Developer Technical Support - v2.0"
  148. };
  149.  
  150. resource 'BNDL' (rAppBundle, purgeable) {
  151.     rAppSignature, 0, {'ICN#', {0, rAppIcon}, 'FREF', {0, rAppBundle}
  152.     }
  153. };
  154.  
  155. resource 'FREF' (rAppBundle, purgeable) {
  156.     'APPL', 0, ""
  157. };
  158.  
  159. resource 'ICN#' (rAppIcon, "App Icon", purgeable) {
  160.     {
  161. /* [1] */
  162.         $"0000 0000 0000 0000 FFFF FFFE 8000 0003"
  163.         $"83FE 0003 8202 1DFB 83FE 0003 8000 0003"
  164.         $"BFFF F1F3 A000 920B AEDE 920B A000 F1F3"
  165.         $"ADD4 9003 A000 91F3 AFB0 920B A000 920B"
  166.         $"ABEC 91F3 A000 9003 A000 F2AB A000 9003"
  167.         $"A000 91F3 BFFF F20B 8000 020B 8000 01F3"
  168.         $"BFFF F003 A000 11F3 ADEC 120B A000 120B"
  169.         $"BFFF F1F3 8000 0003 FFFF FFFF 7FFF FFFF",
  170. /* [2] */
  171.         $"0000 0000 0000 0000 FFFF FFFE FFFF FFFF"
  172.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  173.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  174.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  175.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  176.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  177.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  178.         $"FFFF FFFF FFFF FFFF FFFF FFFF 7FFF FFFF"
  179.     }
  180. };
  181.  
  182. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  183. resource 'vers' (1, purgeable) {
  184.     2, 0, beta, 3, verUs,
  185.     "2.0b3", "2.0b3, Copyright © 1989-90 Apple Developer Technical Support"
  186. };
  187.  
  188.  
  189. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  190. resource 'SIZE' (-1, purgeable) {
  191.     dontSaveScreen,
  192.     acceptSuspendResumeEvents,
  193.     enableOptionSwitch,
  194.     canBackground,                /* we can background, but we're not */
  195.     multiFinderAware,            /* we do our own activate/deactivate */
  196.     backgroundAndForeground,    /* this is not a background-only application! */
  197.     dontGetFrontClicks,            /* standard, don’t want front clicks */
  198.     ignoreChildDiedEvents,        /* I’m not a debugger and I don’t sub-launch */
  199.     is32BitCompatible,            /* this is a 32 bit clean application */
  200.     reserved, reserved, reserved, reserved,
  201.     reserved, reserved, reserved,
  202.     kPrefSize,
  203.     kMinSize
  204. };
  205.  
  206. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  207. // misc strings used for misc reasons
  208.  
  209. resource 'STR#' (rStrMisc, "Misc Strings", purgeable) {
  210.      {
  211. /* [1] */    "K free";
  212. /* [2] */    "Select a Folder";
  213. /* [3] */    "The Cancel button.";
  214. /* [4] */    "Save As…";
  215. /* [5] */    " temp";            /* suffix to temporary file, includes a space */
  216. /* [6] */    "K on disk";
  217.     }
  218. };
  219.  
  220. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  221. // strings used to initializ the List Manager list of file types
  222.  
  223. resource 'STR#' (rStrList, "List Strings", purgeable) {
  224.     {
  225. /* [1] */    "Normal";
  226. /* [2] */    "Text";
  227. /* [3] */    "PICT";
  228. /* [4] */    "TIFF";
  229. /* [5] */    "ESPF";
  230.     }
  231. };
  232.  
  233. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  234. // this ALRT and DITL are used as an About screen
  235.  
  236. resource 'ALRT' (rAboutAlert, "About", purgeable) {
  237.     {0, 0, 136, 290}, rAboutAlert,
  238.     {
  239. /* [1] */     OK, visible, silent,
  240. /* [2] */     OK, visible, silent,
  241. /* [3] */     OK, visible, silent,
  242. /* [4] */     OK, visible, silent
  243.     }
  244. };
  245.  
  246. resource 'DITL' (rAboutAlert, "About", purgeable) {
  247.     {
  248. /* [1] */    {104, 180, 124, 260},    Button {enabled, "OK"},
  249. /* [2] */    {8, 8, 24, 262},        StaticText {disabled, "^0"},
  250. /* [3] */    {32, 8, 48, 65},        StaticText {disabled, "Version:"},
  251. /* [4] */    {32, 65, 64, 270},        StaticText {disabled, "^1"},
  252. /* [5] */     {72, 8, 88, 136},        StaticText {disabled, "Brought to you by:"},
  253. /* [6] */     {96, 24, 128, 167},        StaticText {disabled, "Apple Developer Technical Support"},
  254.     }
  255. };
  256.  
  257. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  258. // These are the resources used to display error messages to the user.
  259.  
  260. resource 'ALRT' (rUserAlert, "User Alert", purgeable) {
  261.     {0, 0, 129, 304}, rUserAlert,
  262.     {
  263. /* [1] */ OK, visible, silent,
  264. /* [2] */ OK, visible, silent,
  265. /* [3] */ OK, visible, silent,
  266. /* [4] */ OK, visible, silent
  267.     }
  268. };
  269.  
  270. resource 'DITL' (rUserAlert, "User Alert", purgeable) {
  271.     {
  272. /* [1] */ {104, 83, 121, 165},     Button        {enabled, "OK"},
  273. /* [2] */ {8, 72, 88, 296},     StaticText    {disabled, "^0  ^1"},
  274. /* [3] */ {10, 20, 42, 52},     Icon         {disabled, rCautionIcon}
  275.     }
  276. };
  277.  
  278. // These are the strings used for error messages.
  279. resource 'STR#' (rErrStrings, purgeable) {
  280.     {
  281. /* [1] */ "An error has occurred.";
  282. /* [2] */ "A Memory Manager error has occurred.";
  283. /* [3] */ "A Resource Manager error has occurred.";
  284. /* [4] */ "Memory is too low to continue.  Try increasing the SIZE resource.";
  285. /* [5] */ "Could not find application's menu resources.";
  286. /* [6] */ "A File System error has occurred.";
  287. /* [7] */ "The file to be remembered has been lost, please select another file.";
  288. /* [8] */ "Requires A/UX version 2.0 or later.";
  289. /* [9] */ "Requires a System with the enhanced ROMs, such as the 512Ke"
  290.     }
  291. };
  292.  
  293. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  294. // These are the resources used for an emergency exit alert.
  295.  
  296. resource 'ALRT' (rExitAlert, "Exit Alert", purgeable) {
  297.     {0, 0, 129, 248}, rExitAlert,
  298.     {
  299. /* [1] */ OK, visible, silent,
  300. /* [2] */ OK, visible, silent,
  301. /* [3] */ OK, visible, silent,
  302. /* [4] */ OK, visible, silent
  303.     }
  304. };
  305.  
  306. resource 'DITL' (rExitAlert, "Exit Alert", purgeable) {
  307.     {
  308. /* [1] */ {104, 83, 121, 165},    Button        {enabled, "OK"},
  309. /* [2] */ {10, 20, 42, 52},        Icon        {disabled, rCautionIcon},
  310. /* [3] */ {8, 72, 40, 240},        StaticText    {disabled, "Sorry, an unrecoverable error has occurred!"},
  311. /* [4] */ {48, 8, 96, 240},        StaticText    {disabled, "^0"}
  312.     }
  313. };
  314.  
  315.  
  316. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  317. // alert used to display some file info when we've found a file
  318.  
  319. resource 'ALRT' (rFInfoAlert, "Found File", purgeable) {
  320.     {40, 40, 188, 354}, rFInfoAlert,
  321.     {
  322.         /* [1] */ OK, visible, sound1,
  323.         /* [2] */ OK, visible, sound1,
  324.         /* [3] */ OK, visible, sound1,
  325.         /* [4] */ OK, visible, sound1
  326.     }
  327. };
  328.  
  329. resource 'DITL' (rFInfoAlert, purgeable) {
  330.     {
  331. /* [1] */ {112, 224, 132, 284}, Button {enabled, "OK"},
  332. /* [2] */ {56, 8, 104, 288}, StaticText {disabled, "File Name: “^0”\nModification date: ^1"},
  333. /* [3] */ {8, 56, 40, 288},    StaticText {disabled, "The following file has been found."},
  334. /* [4] */ {8, 8, 40, 40},    Icon {disabled, 1}
  335.     }
  336. };
  337.  
  338. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  339. // alert used to show the selection made from Std File
  340.  
  341. resource 'ALRT' (rShowSelectionAlert, "Show Selection", purgeable) {
  342.     {42, 42, 214, 406}, rShowSelectionAlert,
  343.     {
  344. /* [1] */ OK, visible, silent,
  345. /* [2] */ OK, visible, silent,
  346. /* [3] */ OK, visible, silent,
  347. /* [4] */ OK, visible, silent
  348.     }
  349. };
  350.  
  351. resource 'DITL' (rShowSelectionAlert, "Show Selection", purgeable) {
  352.     {
  353. /* [1] */ {144, 272, 164, 332},    Button        {enabled, "OK"},
  354. /* [2] */ {32, 64, 136, 344},    StaticText    {disabled, "“^0”"},
  355. /* [3] */ {8, 64, 24, 224},        StaticText    {disabled, "The item selected was:"},
  356. /* [4] */ {10, 20, 42, 52},        Icon        {disabled, rNoteIcon},
  357. /* [5] */ {144, 8, 168, 248},    StaticText     {disabled, "^1"}
  358.     }
  359. };
  360.  
  361. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  362. // a copy of the real Standard GetFile Dialog
  363.  
  364. resource 'DLOG' (kGetFileDLOG, "Std Get File", purgeable) {
  365.     {0, 0, 200, 348}, dBoxProc, invisible, noGoAway, 0x0, kGetFileDLOG, ""
  366. };
  367.  
  368. resource 'DITL' (kGetFileDLOG, "Std Get File", purgeable) {
  369.     {
  370. /* [1] */    {138, 256, 156, 336},    Button        {enabled,"Open"},
  371. /* [2] */    {1152, 59, 1232, 77},    Button        {enabled,"Hidden"},
  372. /* [3] */    {163, 256, 181, 336},    Button        {enabled,"Cancel"},
  373. /* [4] */    {39, 232, 59, 347},        UserItem    {disabled},
  374. /* [5] */    {68, 256, 86, 336},        Button        {enabled,"Eject"},
  375. /* [6] */    {93, 256, 111, 336},    Button        {enabled,"Drive"},
  376. /* [7] */    {39, 12, 185, 230},        UserItem    {enabled},
  377. /* [8] */    {39, 229, 185, 246},    UserItem    {enabled},
  378. /* [9] */    {124, 252, 125, 340},    UserItem    {disabled},
  379. /* [10] */    {1044, 20, 1145, 116},    StaticText    {disabled,""}
  380.     }
  381. };
  382.  
  383.  
  384. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  385. // a copy of the real of Standard PutFile Dialog
  386.  
  387. resource 'DLOG' (kPutFileDLOG, "Std Put File", purgeable) {
  388.     {0, 0, 184, 304}, dBoxProc, invisible, noGoAway, 0x0, kPutFileDLOG, ""
  389. };
  390.  
  391. resource 'DITL' (kPutFileDLOG, "Std Put File", purgeable) {
  392.     {
  393. /* [1] */    {132, 218, 150, 288},    Button        {enabled,"Save"},
  394. /* [2] */    {158, 218, 176, 288},    Button        {enabled,"Cancel"},
  395. /* [3] */    {136, 14, 152, 197},    StaticText    {disabled,"Save as:"},
  396. /* [4] */    {29, 198, 49, 302},        UserItem    {disabled},
  397. /* [5] */    {56, 218, 74, 288},        Button        {enabled,"Eject"},
  398. /* [6] */    {82, 218, 100, 288},    Button        {enabled,"Drive"},
  399. /* [7] */    {157, 17, 173, 194},    EditText    {enabled,""},
  400. /* [8] */    {29, 14, 127, 197},        UserItem    {disabled}
  401.     }
  402. };
  403.  
  404.  
  405. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  406. // used in SFGetFile with a multi-file list
  407.  
  408. resource 'DLOG' (rListGetDLOG, "Multi Get File", purgeable) {
  409.     {40, 40, 324, 398}, dBoxProc, invisible, noGoAway, 0x0, rListGetDLOG, ""
  410. };
  411.  
  412. resource 'DITL' (rListGetDLOG, "Multi Get File", purgeable) {
  413.     {
  414. /* [1] */    {216, 256, 234, 336},    Button        {enabled, "Add"},
  415. /* [2] */    {1152, 59, 1232, 77},    Button        {enabled, ""},
  416. /* [3] */    {163, 256, 181, 336},    Button        {enabled, "Cancel"},
  417. /* [4] */    {39, 232, 59, 347},        UserItem    {disabled},
  418. /* [5] */    {68, 256, 86, 336},        Button        {enabled, "Eject"},
  419. /* [6] */    {93, 256, 111, 336},    Button        {enabled, "Drive"},
  420. /* [7] */    {39, 12, 185, 230},        UserItem    {enabled},
  421. /* [8] */    {39, 229, 185, 246},    UserItem    {enabled},
  422. /* [9] */    {124, 252, 125, 340},    UserItem    {disabled},
  423. /* [10] */    {1044, 20, 1145, 116},    StaticText    {disabled, ""},
  424. /* [11] */    {202, 12, 280, 230},    UserItem    {disabled},
  425. /* [12] */    {138, 256, 156, 336},    Button        {enabled, "Open"},
  426. /* [13] */    {241, 256, 259, 336},    Button        {enabled, "Remove"}
  427.     }
  428. };
  429.  
  430. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  431. // Used for custom SFPGetFile having a filter controlled by some buttons
  432.  
  433. resource 'DLOG' (rSFPGetFileDLOG, "Custom Get File", purgeable) {
  434.     {0, 0, 200, 349}, dBoxProc, invisible, noGoAway, 0x0, rSFPGetFileDLOG, ""
  435. };
  436.  
  437. resource 'DITL' (rSFPGetFileDLOG, "Custom Get File", purgeable) {
  438.     {
  439. /* [1] */    {138, 256, 156, 336},    Button        {enabled,"Open"};
  440. /* [2] */    {1152, 59, 1232, 77},    Button        {enabled,"Hidden"};
  441. /* [3] */    {163, 256, 181, 336},    Button        {enabled,"Cancel"};
  442. /* [4] */    {39, 252, 59, 347},        UserItem    {disabled};
  443. /* [5] */    {68, 256, 86, 336},        Button        {enabled,"Eject"};
  444. /* [6] */    {93, 256, 111, 336},    Button        {enabled,"Drive"};
  445. /* [7] */    {39, 12, 180, 230},        UserItem    {enabled};
  446. /* [8] */    {39, 229, 180, 245},    UserItem    {enabled};
  447. /* [9] */    {124, 252, 125, 340},    UserItem    {disabled};
  448. /* [10] */    {1044, 20, 1145, 116},    StaticText    {disabled,""};
  449. /* [11] */    {1, 14, 20, 142},        RadioButton    {enabled,"Text files only"};
  450. /* [12] */    {19, 14, 38, 176},        RadioButton    {enabled,"Applications only"};
  451.     }
  452. };
  453.  
  454.  
  455. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  456. // Used for custom SFPPutFile that displays the free space, and controls
  457. // which files to be viewed
  458.  
  459. resource 'DLOG' (rSFPPutFileDLOG, "Custom Put File", purgeable) {
  460.     {0, 0, 164, 304}, dBoxProc, invisible, noGoAway, 0x0, rSFPPutFileDLOG, ""
  461. };
  462.  
  463. resource 'DITL' (rSFPPutFileDLOG, "Custom Put File", purgeable) {
  464.      {
  465. /* [1] */    {74, 12, 92, 82},        Button        {enabled,"Save"};
  466. /* [2] */    {74, 114, 92, 184},        Button        {enabled,"Cancel"};
  467. /* [3] */    {12, 12, 28, 184},        StaticText    {disabled,"Save as:"};
  468. /* [4] */    {16, 209, 34, 295},        UserItem    {disabled};
  469. /* [5] */    {74, 217, 92, 287},        Button        {enabled,"Eject"};
  470. /* [6] */    {101, 217, 119, 287},    Button        {enabled,"Drive"};
  471. /* [7] */    {34, 14, 50, 182},        EditText    {enabled,""};
  472. /* [8] */    {16, 200, 88, 201},        UserItem    {disabled};
  473. /* [9] */    {102, 11, 122, 108},    RadioButton    {enabled,"Normal"};
  474. /* [10] */    {129, 11, 149, 108},    RadioButton {enabled,"Text Only"};
  475. /* [11] */    {37, 202, 73, 303},        UserItem    {disabled}
  476.     }
  477. };
  478.  
  479.  
  480. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  481. // Used for Get Directory
  482.  
  483. resource 'DLOG' (rGetDirectoryDLOG, "Get Directory", purgeable) {
  484.     {0, 0, 217, 348}, dBoxProc, invisible, noGoAway, 0x0, rGetDirectoryDLOG, ""
  485. };
  486.  
  487. resource 'DITL' (rGetDirectoryDLOG, "Get Directory", purgeable) {
  488.     {
  489. /* [1] */    {142, 256, 160, 336},    Button        {enabled,"Open"},
  490. /* [2] */    {1152, 59, 1232, 77},    Button        {enabled,"Hidden"},
  491. /* [3] */    {193, 256, 211, 336},    Button        {enabled,"Cancel"},
  492. /* [4] */    {43, 232, 63, 347},        UserItem    {disabled},
  493. /* [5] */    {72, 256, 90, 336},        Button        {enabled,"Eject"},
  494. /* [6] */    {97, 256, 115, 336},    Button        {enabled,"Drive"},
  495. /* [7] */    {43, 12, 189, 230},        UserItem    {enabled},
  496. /* [8] */    {43, 229, 189, 246},    UserItem    {enabled},
  497. /* [9] */    {128, 252, 129, 340},    UserItem    {disabled},
  498. /* [10] */    {1044, 20, 1145, 116},    StaticText    {disabled,""},
  499. /* [11] */    {167, 256, 185, 336},    Button        {enabled,"Directory"},
  500. /* [12] */    {0, 30, 18, 215},        Button        {enabled,"Select Current Directory:"},
  501. /* [13] */    {200, 20, 1145, 136},    StaticText    {disabled,""}
  502.     }
  503. };
  504.  
  505.  
  506. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  507. // used in PPutFile to display a list containing a set of file types
  508.  
  509. resource 'DLOG' (rPutListsFileDLOG, "List In Put", purgeable) {
  510.     {0, 0, 262, 304}, dBoxProc, invisible, noGoAway, 0x0, rPutListsFileDLOG, ""
  511. };
  512.  
  513. resource 'DITL' (rPutListsFileDLOG, "List In Put", purgeable) {
  514.     {
  515. /* [1] */    {132, 218, 150, 288},    Button        {enabled,"Save"},
  516. /* [2] */    {158, 218, 176, 288},    Button        {enabled,"Cancel"},
  517. /* [3] */    {136, 14, 152, 197},    StaticText    {disabled,"Save as:"},
  518. /* [4] */    {29, 198, 49, 302},        UserItem    {disabled},
  519. /* [5] */    {56, 218, 74, 288},        Button        {enabled,"Eject"},
  520. /* [6] */    {82, 218, 100, 288},    Button        {enabled,"Drive"},
  521. /* [7] */    {157, 17, 173, 194},    EditText    {enabled,""},
  522. /* [8] */    {29, 14, 127, 197},        UserItem    {disabled},
  523. /* [9] */    {185, 14, 257, 150},    UserItem    {disabled}
  524.     }
  525. };
  526.  
  527.  
  528. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  529. // used in PPutFile to install an option button which brings up an additional
  530. // dialog containing a set of file types
  531.  
  532. resource 'DLOG' (rOptionsDLOG, "Options Put", purgeable) {
  533.     {0, 0, 214, 304}, dBoxProc, invisible, noGoAway, 0x0, rOptionsDLOG, ""
  534. };
  535.  
  536. resource 'DITL' (rOptionsDLOG, "Options Put", purgeable) {
  537.     {
  538. /* [1] */    {132, 218, 150, 288},    Button        {enabled,"Save"},
  539. /* [2] */    {158, 218, 176, 288},    Button        {enabled,"Cancel"},
  540. /* [3] */    {136, 14, 152, 197},    StaticText    {disabled,"Save as:"},
  541. /* [4] */    {29, 198, 49, 302},        UserItem    {disabled},
  542. /* [5] */    {56, 218, 74, 288},        Button        {enabled,"Eject"},
  543. /* [6] */    {82, 218, 100, 288},    Button        {enabled,"Drive"},
  544. /* [7] */    {157, 17, 173, 194},    EditText    {enabled,""},
  545. /* [8] */    {29, 14, 127, 197},        UserItem    {disabled},
  546. /* [9] */    {184, 218, 202, 288},    Button        {enabled,"Options…"},
  547. /* [10] */    {184, 14, 202, 197},    StaticText    {disabled,"ZowiePaint"},
  548.     }
  549. };
  550.  
  551.  
  552. resource 'DLOG' (rOptionsSubDLOG, "Options Sub-Dialog", purgeable) {
  553.     {40, 40, 184, 306}, dBoxProc, visible, noGoAway, 0x0, rOptionsSubDLOG, ""
  554. };
  555.  
  556. resource 'DITL' (rOptionsSubDLOG, "Options Sub-Dialog", purgeable) {
  557.     {
  558. /* [1] */    {112, 176, 132, 236},    Button        {enabled,"OK"},
  559. /* [2] */    {112, 96, 132, 156},    Button        {enabled,"Cancel"},
  560. /* [3] */    {40, 24, 56, 120},        RadioButton    {enabled,"ZowiePaint"},
  561. /* [4] */    {56, 24, 72, 120},        RadioButton    {enabled,"PICT2"},
  562. /* [5] */    {72, 24, 88, 120},        RadioButton    {enabled,"PICT"},
  563. /* [6] */    {40, 144, 56, 240},        RadioButton    {enabled,"MacPaint"},
  564. /* [7] */    {72, 144, 88, 240},        RadioButton    {enabled,"TIFF"},
  565. /* [8] */    {56, 144, 72, 240},        RadioButton    {enabled,"PixelPaint"},
  566. /* [9] */    {24, 16, 96, 248},        UserItem    {disabled},
  567. /* [10] */    {16, 32, 36, 92},        StaticText    {disabled,"Formats"}
  568.     }
  569. };
  570.  
  571. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  572. // used in PGetFile to demonstrate idle time.  It contains some statText items
  573. // which are updated during the idle events.  In addition, a window is created
  574. // in the background which is asking for update events. 
  575.  
  576. resource 'DLOG' (rGetIdleUpdates, "Idle Updates", purgeable) {
  577.     {0, 0, 232, 348}, dBoxProc, invisible, noGoAway, 0x0, rGetIdleUpdates, ""
  578. };
  579.  
  580. resource 'DITL' (rGetIdleUpdates, "Idle Updates", purgeable) {
  581.     {
  582. /* [1] */    {138, 256, 156, 336},    Button        {enabled, "Open"},
  583. /* [2] */    {1152, 59, 1232, 77},    Button        {enabled, "Hidden"},
  584. /* [3] */    {163, 256, 181, 336},    Button        {enabled, "Cancel"},
  585. /* [4] */    {39, 232, 59, 347},        UserItem    {disabled},
  586. /* [5] */    {68, 256, 86, 336},        Button        {enabled, "Eject"},
  587. /* [6] */    {93, 256, 111, 336},    Button        {enabled, "Drive"},
  588. /* [7] */    {39, 12, 185, 230},        UserItem    {enabled},
  589. /* [8] */    {39, 229, 185, 246},    UserItem    {enabled},
  590. /* [9] */    {124, 252, 125, 340},    UserItem    {disabled},
  591. /* [10] */    {1044, 20, 1145, 116},    StaticText    {disabled, ""},
  592. /* [11] */    {16, 248, 32, 344},        StaticText    {disabled, ""},
  593. /* [12] */    {200, 12, 220, 344},    StaticText    {disabled, ""}
  594.     }
  595. };
  596.  
  597. resource 'WIND' (rUpdateWindow, "Update Window", purgeable) {
  598.     {45, 20, 236, 340}, documentProc, visible, noGoAway, 0x0, "Window needing updates"
  599. };
  600.  
  601.  
  602. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  603. // The animated cursor resource used in the MPW CursorCtl unit is not
  604. // defined by MPW.  So, I’ve created the type for it.
  605. // These are the resources used for the animated cursors.  They are preloaded
  606. // and non-purgeable to help reduce memory fragmentation.
  607.  
  608.  
  609. type 'acur' {
  610.     integer = $$Countof(AcursArray);    /*Number of cursors (“frames of film”)*/
  611.     fill word;                            /*Next frame to show <for internal use>*/
  612.     wide array AcursArray {
  613.         integer;                        /*'CURS' resource id for frame #1*/
  614.         fill word;                        /*<for internal use>*/
  615.     };
  616. };
  617.  
  618. resource 'acur' (0, preload, nonPurgeable) {
  619.     {
  620.     rACursor1, rACursor2, rACursor3, rACursor4
  621.     }
  622. };
  623.  
  624. resource 'CURS' (rACursor1, preload, nonPurgeable) {
  625.     $"00 00 00 00 00 00 16 00 3E 01 54 03 C3 05 F3 FD"
  626.     $"08 FA 0C 72 0C 02 0D F2 0A 0A 0A 0A 0A 0A 1C 1E",
  627.     $"00 00 00 00 00 00 16 00 3E 01 7C 03 FF 07 FF FF"
  628.     $"0F FE 0F FE 0F FE 0F FE 0E 0E 0E 0E 0E 0E 1C 1E",
  629.     {4, 10}
  630. };
  631.  
  632. resource 'CURS' (rACursor2, preload, nonPurgeable) {
  633.     $"30 30 28 38 24 24 13 AC 0B C6 04 0C 02 36 02 36"
  634.     $"02 E0 02 E0 0E E0 10 60 26 20 29 90 28 50 30 38",
  635.     $"30 30 38 38 3C 3C 1F BC 0F FE 07 FC 03 F6 03 F6"
  636.     $"03 E0 03 E0 0F E0 1F E0 3F E0 39 F0 38 70 30 38",
  637.     {15, 7}
  638. };
  639.  
  640. resource 'CURS' (rACursor3, preload, nonPurgeable) {
  641.     $"00 00 06 C0 0A A0 12 90 14 58 17 D8 20 18 27 18"
  642.     $"4F 18 9F CF E0 C3 80 2A 00 FC 00 D0",
  643.     $"00 00 06 C0 0E E0 1E F0 1C 78 1F F8 3F F8 3F F8"
  644.     $"7F F8 FF FF E0 FF 80 3E 00 FC 00 D0",
  645.     {9, 6}
  646. };
  647.  
  648. resource 'CURS' (rACursor4, preload, nonPurgeable) {
  649.     $"0E 06 05 0A 04 CA 02 32 03 04 03 B8 03 A0 03 A0"
  650.     $"36 20 36 20 18 10 31 E8 1A E4 12 12 0E 0A 06 06",
  651.     $"0E 06 07 0E 07 CE 03 FE 03 FC 03 F8 03 E0 03 E0"
  652.     $"37 E0 37 E0 1F F0 3F F8 1E FC 1E 1E 0E 0E 06 06",
  653.     {6, 6}
  654. };
  655.  
  656.  
  657. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  658. // I've created custom a template and resource to remember a file.
  659.  
  660. type 'FILE' {
  661.     hex string [28];                    /*volume name (27 chars)*/
  662.     unsigned longint;                    /*dirID is a LongInt*/
  663.     hex string [64];                    /*file name (63 chars)*/
  664. };
  665.  
  666.  
  667. resource 'FILE' (rMemorizedFile, purgeable) {"", 0, ""};
  668.  
  669.  
  670.  
  671.